/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vehicles;

/**
 *
 * @author jonesbr
 */
public class Tundra extends Car {

    private String gasType = "E85";

    public void go(int distance) {

        // compute the gallons of gas used.
        double gallonsOfGasUsed = distance / milesPerGallon;

        // if it is a tundra, and it is using E85, we need to perform a different MPG calcualtion.
        if (gasType.equals("E85")) {
            double e85mpg = milesPerGallon * 2 / 3;
            gallonsOfGasUsed = distance / e85mpg;
        }
        
        // add gallonsOfGasUsed to the running tally; gasConsumed.
        gasConsumed += gallonsOfGasUsed;


        // subtract the gallons used from the gallons available.
        gallonsOfGas = gallonsOfGas - gallonsOfGasUsed;
    }

    @Override
    public String getCarClass() {
        return "Tundra";
    }
}
